package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.dto.SetmealPageQueryDTO;
import com.sky.entity.Setmeal;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import com.sky.vo.SetmealVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealMapper {
    List page(SetmealPageQueryDTO setmealPageQueryDTO);

    @AutoFill(value = OperationType.INSERT)
    void insert(Setmeal setmeal);

    @Select("select count(1) from setmeal where category_id = #{id}")
    int countByCategoryId(Long id);


    void insertSetmealDishes(Long id, List<SetmealDish> setmealDishes);

    Setmeal getById(Long id);
    @AutoFill(value = OperationType.UPDATE)
    void update(Setmeal setmeal);

    void deleteSetmealDishesBySetmealId(List<Long> list);

    void delete(List<Long> ids);

    @AutoFill(value = OperationType.UPDATE)
    void permission(Setmeal setmeal);
}
